package com.cjj.paysbdemo.servlet.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cjj.paysbdemo.mapper.OrderMapper;
import com.cjj.paysbdemo.pojo.Order;
import com.cjj.paysbdemo.servlet.OrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class OrderServiceImpl implements OrderService {

    @Resource
    private OrderMapper orderMapper;

    public int add(Order order){
        return  orderMapper.insert(order);
    }

    @Override
    public Order findByNo(String orderNo) {

        return orderMapper.selectOne(new QueryWrapper<Order>().eq("order_no",orderNo));
    }

    @Override
    public int update(Order order) {
        return orderMapper.updateById(order);
    }
}
